<!DOCTYPE html>
<html lang="zh-cn">
<head>

    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>绑定管理员</title>

    <script src="__BUILDER_JS__/vue.min.js?__VERSION__"></script>
    <link  rel="stylesheet" type="text/css"  href="__BUILDER_CSS__/vant.css?__VERSION__" />
    <script src="__BUILDER_JS__/store.min.js?__VERSION__"></script>
    <script src="__BUILDER_JS__/request.js?__VERSION__"></script>
    <script src="__BUILDER_JS__/vant.min.js?__VERSION__"></script>
    <script src="__BUILDER_JS__/util.js?__VERSION__"></script>
    <script src="__BUILDER_JS__/axios.js?__VERSION__"></script>

 
</head>

<style>
    .qr_body{
        display: flex;
        flex-direction: column;
        justify-items: center;
        align-items: center;
    }
    .qr_icon_text{
        display: flex;
        flex-direction: column;
        justify-items: center;
        align-items: center;
        margin: 30% 0 0 0;
    }
    .qr_icon_text svg{
        margin-bottom: 5px;
    }
    .qr_icon_text div{
        font-weight: 100;
        font-size:24px;
        text-align: center;
    }
    .qr_btn{
        position:fixed;
        display: flex;
        flex-direction: column;
        justify-items: center;
        align-items: center;
        bottom:12%;
        font-size:15px;
        width:50%;
    }
    .qr_btn a{
        margin-top:28px;
        color:#3b3b73;
        text-align: center;
    }
    .van-button__text{
        font-size:16px !important;
    }
</style>
<body>
    
    <div class="qr_body">
            <div class="qr_icon_text">
                    <svg t="1616553593887" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="14051" data-spm-anchor-id="a313x.7781069.0.i23" width="155" height="155"><path d="M911.7 127.7H112.3C80.2 127.7 54 153.8 54 186v519.8c0 32.1 26.2 58.3 58.3 58.3h295.4v62.3c0 7.6-2.6 15-7.3 21l-15.8 12.9c-6.7 5.5-9.2 14.4-6.3 22.6 2.9 8.2 10.4 13.5 19.2 13.5h229.1c8.7 0 16.2-5.3 19.2-13.5 2.9-8.2 0.5-17.1-6.3-22.6l-15.8-12.9c-4.7-6-7.3-13.4-7.3-21v-62.3h295.4c32.1 0 58.3-26.2 58.3-58.3V186c-0.1-32.2-26.3-58.3-58.4-58.3zM608.9 860.8c0.4 0.5 0.9 0.9 1.3 1.3l16.6 13.5 0.1 0.1c0 0.1-0.1 0.4-0.1 0.5H397.3c-0.1-0.1-0.2-0.4-0.2-0.4l0.2-0.2 16.6-13.5c0.5-0.4 0.9-0.8 1.3-1.3 8.1-9.7 12.5-21.9 12.5-34.5V764h168.6v62.3c0 12.6 4.5 24.9 12.6 34.5z m341.1-155c0 21.1-17.2 38.3-38.3 38.3H112.3c-21.1 0-38.3-17.2-38.3-38.3V186c0-21.1 17.2-38.3 38.3-38.3h799.4c21.1 0 38.3 17.2 38.3 38.3v519.8z" fill="#707070" p-id="14052" data-spm-anchor-id="a313x.7781069.0.i26" class=""></path><path d="M865.3 202.3H158.7c-18.6 0-33.8 15.1-33.8 33.8v387.2c0 18.6 15.1 33.8 33.8 33.8h706.6c18.6 0 33.8-15.1 33.8-33.8V236c0-18.6-15.2-33.7-33.8-33.7z m13.8 420.9c0 7.6-6.2 13.8-13.8 13.8H158.7c-7.6 0-13.8-6.2-13.8-13.8V236c0-7.6 6.2-13.8 13.8-13.8h706.6c7.6 0 13.8 6.2 13.8 13.8v387.2z" fill="#8a8a8a" p-id="14053" data-spm-anchor-id="a313x.7781069.0.i24" class=""></path></svg>
                    <div>
                      绑定成为管理员
                    </div>
            </div>
            <div class="qr_btn">
                    <van-button type="primary" @click="updateStates(1)" round block>绑定</van-button>
                    <a id="close" @click="updateStates(3)">关闭页面</a>
            </div>
    </div>
    <script>
        var userInfo = {:json_encode($list,JSON_UNESCAPED_UNICODE)}; 
        var alpha_id = get_url_param_value('alpha_id');
        var url = "{:url('auth/Manager/updateManagerWxopenid','',true,true)}";
        var token_url = "{:url('api/Request/createJwt')}";
        var http = new Request({token_url:token_url});
        var data = {alpha_id:alpha_id,value:userInfo['wx_openid'],field:'wx_openid'};
        // var result = http.request('post',url,data);
        
        // if(result['code'] == 0){
        //     WeixinJSBridge.call('closeWindow');
        // }else{
        //     alert(result['msg']);
        // }

        new Vue({
            el: '.qr_body',
            created(){
                let that = this;
                that.init();
            },
            methods:{
                init:function(){
                    
                },
                updateStates(status){
                    data = {alpha_id:alpha_id,value:userInfo['wx_openid'],field:'wx_openid'};
                    var res = http.request('post',url,data);
                    vant.Notify({ type: 'success', message: res['msg'] });
                    if(res['code']==0){
                        WeixinJSBridge.call('closeWindow'); 
                    }
                }
            },
        });

  
       
    </script>
    <script>
         document.addEventListener('WeixinJSBridgeReady', function(){
        //关闭页面。
        //  WeixinJSBridge.call('closeWindow'); 

        document.getElementById("close").addEventListener("click",function(){
            WeixinJSBridge.call('closeWindow'); 
        })
        //隐藏右上角三个点按钮。
        WeixinJSBridge.call('hideOptionMenu'); 
        //显示右上角三个点按钮
        // WeixinJSBridge.call('showOptionMenu'); 
    
        //显示右下面工具栏
        // WeixinJSBridge.call('showToolbar'); 
        //隐藏右下面工具栏
        WeixinJSBridge.call('hideToolbar'); 

        }, false);

        WeixinJSBridge.call('closeWindow');
        WeixinJSBridge.call('hideOptionMenu'); 
        WeixinJSBridge.call('hideToolbar'); 
    </script>
</body>
</html>